package com.shenglue.ssi.service;

import java.util.List;

import com.shenglue.ssi.dao.BuyBackMainDao;
import com.shenglue.ssi.dao.SuppDao;
import com.shenglue.ssi.domain.BuyBackMain;
import com.shenglue.ssi.domain.Supp;

public class BuyBackMainServiceImpl implements BuyBackMainService {

	private BuyBackMainDao buyBackMainDao;
	private SuppDao		 suppDao;

	public BuyBackMainDao getBuyBackMainDao() {
		return buyBackMainDao;
	}

	public void setBuyBackMainDao(BuyBackMainDao buyBackMainDao) {
		this.buyBackMainDao = buyBackMainDao;
	}

	public SuppDao getSuppDao() {
		return suppDao;
	}

	public void setSuppDao(SuppDao suppDao) {
		this.suppDao = suppDao;
	}

	/**
	 * 查询所有入库退货单主表信息
	 */
	public List<BuyBackMain> selectAllBuyBackMain() {
		return buyBackMainDao.selectAllBuyBackMain();
	}

	/**
	 * 按条件查询 入库退货单主表信息
	 */
	public List<BuyBackMain> selectBuyBackMainByCond( BuyBackMain buyBackMain ) {
		return buyBackMainDao.selectBuyBackMainByCond( buyBackMain );
	}

	/**
	 * 增加入库退货单主表记录
	 */
	public boolean saveBuyBackMain(BuyBackMain buyBackMain){
		return buyBackMainDao.saveBuyBackMain(buyBackMain);
	}

	/**
	 * 删除入库退货单主表记录
	 */
	public boolean deleteBuyBackMain(int buyBackId) {
		return buyBackMainDao.deleteBuyBackMain( buyBackId );
	}

	/**
	 * 修改入库退货单主表记录
	 */
	public boolean updateBuyBackMain(BuyBackMain buyBackMain){
		return buyBackMainDao.updateBuyBackMain(buyBackMain);
	}

	/**
	 * 为修改，根据 Id 查一条 入库退货单主表记录
	 */
	public BuyBackMain getOneBuyBackMainForUpdate( int buyBackId ){
		return buyBackMainDao.getOneBuyBackMainForUpdate( buyBackId );
	}

	/**
	 * 查询所有供应商信息
	 */
	public List<Supp> selectAllSupp() {
		return suppDao.selectAllSupp();
	}

}
